<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"
         import="com.syas.common.extension.UrlHelper"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ include file="../shared/taglib.jsp"%>

<html>
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!--> <html lang="en" class="no-js"> <!--<![endif]-->
<head>
    <meta charset="utf-8" />
    <title>Conquer | Form Stuff - Form Controls</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta content="width=device-width, initial-scale=1.0" name="viewport" />
    <meta content="" name="description" />
    <meta content="" name="author" />
    <meta name="MobileOptimized" content="320">

    <%@ include file="../shared/importCss.jsp"%>
    <!-- BEGIN PAGE LEVEL STYLES -->
    <link rel="stylesheet" href="<c:url value='/plugins/data-tables/DT_bootstrap.css'/>" type="text/css"/>
    <!-- END PAGE LEVEL STYLES -->

    <%@ include file="../shared/importJs.jsp"%>
    <!-- BEGIN PAGE LEVEL SCRIPTS -->
    <script type="text/javascript" src="<c:url value='/plugins/data-tables/jquery.dataTables.js'/>"></script>
    <script type="text/javascript" src="<c:url value='/plugins/data-tables/DT_bootstrap.js'/>"></script>
    <script type="text/javascript" src="<c:url value='/plugins/uniform/jquery.uniform.min.js'/>"></script>
    <script type="text/javascript" src="<c:url value='/js/jquery.toolbarlite.js?ver=10'/>"></script>
    <script type="text/javascript" src="<c:url value='/js/app.js'/>"></script>
    <script type="text/javascript" src="<c:url value='/js/jquery.tableManaged.js'/>"></script>
    <!-- END PAGE LEVEL SCRIPTS -->

    <link rel="shortcut icon" href="favicon.ico" />
</head>
<!-- END HEAD -->

<!-- BEGIN BODY -->
<body class="page-header-fixed">

<%@ include file="../shared/pageHeader.jsp"%>

<div class="clearfix"></div>
<!-- BEGIN CONTAINER -->
<div class="page-container">

    <%@ include file="../shared/sidebarMenu.jsp"%>

    <!-- BEGIN PAGE -->
    <div class="page-content">

        <%@ include file="../shared/styleSet.jsp"%>

        <!-- BEGIN PAGE HEADER-->
        <div class="row">
            <div class="col-md-12">
                <!-- BEGIN PAGE TITLE & BREADCRUMB-->
                <h3 class="page-title">
                    Form Controls <small>form controls and more</small>
                </h3>
                <ul class="page-breadcrumb breadcrumb">
                    <li>
                        <i class="icon-home"></i>
                        <a href="<c:url value='/home/index'/>">首页</a>
                        <i class="icon-angle-right"></i>
                    </li>
                    <li>
                        <span>${requestScope.permissionMenu.rootName}</span>
                        <i class="icon-angle-right"></i>
                    </li>
                    <li><span>${requestScope.permissionMenu.subName}</span></li>
                </ul>
                <!-- END PAGE TITLE & BREADCRUMB-->
            </div>
        </div>
        <!-- END PAGE HEADER-->
        <!-- BEGIN PAGE CONTENT-->
        <div class="row">
            <div class="col-md-12">
                <div class="portlet box light-grey">
                    <%-- <div class="portlet-title">
                        <div class="caption"><i class="icon-search"></i>数据检索</div>
                     </div>--%>
                    <ul id="myTab" class="nav nav-tabs">
                        <li class="active">
                            <a href="#baseinfosearch" data-toggle="tab">
                                基础信息检索
                            </a>
                        </li>
                        <li>
                            <a href="#orginfosearch" data-toggle="tab">
                                组织结构搜索
                            </a>
                        </li>
                    </ul>
                    <div id="myTabContent" class="tab-content">
                        <div class="tab-pane fade in active" id="baseinfosearch">
                            <div class="portlet-body form">
                                <!-- BEGIN FORM-->
                                <form:form modelAttribute="searchModel" class="form-horizontal" method="GET">
                                    <div class="form-body">
                                        <div class="row">
                                            <div class="col-md-2">
                                                <div class="form-group">
                                                    <label class="control-label col-md-3">姓名</label>
                                                    <div class="col-md-9">
                                                        <form:input path="name" class="form-control placeholder-no-fix" autocomplete="off" placeholder="姓名"/>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-md-3">
                                                <div class="form-group">
                                                    <label class="control-label col-md-3">e租宝账户</label>
                                                    <div class="col-md-8">
                                                        <form:input path="ezubouname" class="form-control placeholder-no-fix" autocomplete="off" placeholder="e租宝账户"/>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-md-2">
                                                <div class="form-group">
                                                    <label class="control-label col-md-4">手机号</label>
                                                    <div class="col-md-8">
                                                        <form:input path="mobileno" class="form-control placeholder-no-fix" autocomplete="off" placeholder="手机号"/>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-md-3">
                                                <div class="form-group">
                                                    <label class="control-label col-md-3">身份证号码</label>
                                                    <div class="col-md-8">
                                                        <form:input path="certid" class="form-control placeholder-no-fix" autocomplete="off" placeholder="身份证号码"/>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-md-2">
                                                <div class="form-group">
                                                    <button type="submit" class="btn btn-success" style="width: 100px">搜索</button>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <%--<div class="form-actions">
                                        <div class="row">
                                            <div class="col-md-12">
                                                <div class="col-md-offset-5">
                                                    <button type="submit" class="btn btn-success" style="width: 200px">搜索</button>
                                                </div>
                                            </div>
                                        </div>
                                    </div>--%>
                                </form:form>
                                <!-- END FORM-->
                            </div>
                        </div>
                        <div class="tab-pane fade" id="orginfosearch">

                        </div>

                    </div>

                </div>
                <div class="row">
                    <div class="col-md-12">
                        <div class="portlet box light-grey" >
                            <form id="excelform" name="excelform" action="/orgfrmger/emplist" enctype="multipart/form-data"  method="POST" >
                                <input id = "excelFileUpload" name = "excelFileUpload" type="file" class="col-md-8" >
                                <button type="button" class="btn btn-success" style="width: 100px" onclick="uploadExcel();">导入</button>
                            </form>
                        </div>
                    </div>
                </div>
                <!-- BEGIN EXAMPLE TABLE PORTLET-->
                <div class="portlet box light-grey">
                    <div class="portlet-title">
                        <div class="caption"><i class="icon-table"></i>${requestScope.permissionMenu.curName}</div>
                    </div>
                    <div class="portlet-body">
                        <div class="table-toolbar"></div>
                        <div class="dataTables_wrapper form-inline" role="grid">
                            <div class="table-scrollable">
                                <table class="table table-striped table-bordered table-hover" id="data-table">
                                    <thead>
                                    <tr>
                                        <th class="table-checkbox"><input type="checkbox" class="group-checkable"/></th>
                                        <th>姓名</th>
                                        <th >身份证号</th>
                                        <th >所属团队</th>
                                        <th >所属分部</th>
                                        <th >所属营业部</th>
                                        <th >所属分公司</th>
                                        <th >所属区域</th>
                                        <th >所属公司</th>
                                        <th >岗位</th>
                                        <th >级别</th>
                                        <th >入职日期</th>
                                        <th >实际转正时间</th>
                                        <th >离职时间</th>
                                        <th >当月绩效工资标准</th>
                                        <th >人员类别</th>
                                        <th >在职状态</th>
                                        <th >城市类别</th>
                                        <th >职能类别</th>
                                        <th >是否筹建期</th>
                                        <th >工作地（市）</th>
                                        <th >员工e租宝账号</th>
                                        <th >直属领导</th>
                                        <th >直属领导e租宝账号</th>
                                        <th >到岗日期</th>
                                        <th >离岗日期</th>
                                        <th >修改时间</th>
                                        <th >创建时间</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <c:forEach items="${contentModel.items}" var="item">
                                        <tr class="odd gradeX">
                                            <td class="check_cell">
                                                <input type="checkbox" class="checkboxes" name="Id" value="${ item.id }" />
                                            </td>
                                            <td>${ item.realName }</td>
                                            <td>${ item.certId }</td>
                                            <td>${ item.departmentLevel6 }</td>
                                            <td>${ item.departmentLevel5 }</td>
                                            <td>${ item.departmentLevel4 }</td>
                                            <td>${ item.departmentLevel3 }</td>
                                            <td>${ item.departmentLevel2 }</td>
                                            <td>${ item.departmentLevel1 }</td>
                                            <td>${ item.postType }</td>
                                            <td>${ item.level }</td>
                                            <td>${ item.joinDate.toLocaleString() }</td>
                                            <td>${ item.realemployeeDate.toLocaleString() }</td>
                                            <td>${ item.leaveDate.toLocaleString() }</td>
                                            <td>${ item.salaryBase }</td>
                                            <td>${ item.empType }</td>
                                            <td>${ item.empStatus }</td>
                                            <td>${ item.cityType }</td>
                                            <td>${ item.functionType }</td>
                                            <td>${ item.isBuilding }</td>
                                            <td>${ item.workPlace }</td>
                                            <td>${ item.ezboUname }</td>
                                            <td>${ item.leaderName }</td>
                                            <td>${ item.leaderEzboUname }</td>
                                            <td>${ item.workStartdate.toLocaleString() }</td>
                                            <td>${ item.workLeavedate.toLocaleString() }</td>
                                            <td>${ item.createDate.toLocaleString()}</td>
                                            <td>${ item.updateDate.toLocaleString()}</td>
                                        </tr>
                                    </c:forEach>
                                    </tbody>
                                </table>
                            </div>
                            <c:import url = "../shared/paging.jsp">
                                <c:param name="pageModelName" value="contentModel"/>
                                <c:param name="urlAddress" value="/orgfrmger/emplist"/>
                            </c:import>
                        </div>
                    </div>
                </div>
                <!-- END EXAMPLE TABLE PORTLET-->
            </div>
        </div>
        <!-- END PAGE CONTENT-->
    </div>
    <!-- END PAGE -->
</div>
<!-- END CONTAINER -->
<%@ include file="../shared/pageFooter.jsp"%>
<script type="text/javascript">
    $(function() {
        App.init();
        $("#data-table").tableManaged();
        $(".table-toolbar").toolbarLite({
            items: [
                { link: true, display: "新建", css: "icon-plus", showIcon: true, url: "<%=UrlHelper.resolveWithReturnUrl("/orgfrmger/add", request.getAttribute("requestUrl"), request.getAttribute("requestQuery"), pageContext)%>"},
                { splitter: true },
                { link: true, display: "编辑", css: "icon-edit", showIcon: true, url: "<%=UrlHelper.resolveWithReturnUrl("/orgfrmger/edit/{0}", request.getAttribute("requestUrl"), request.getAttribute("requestQuery"), pageContext)%>",
                    selector: "#data-table .checkboxes", mustSelect: "请先选择数据！", singleSelect: "该操作只支持单选！"},
                { splitter: true },
                { link: true, display: "绑定组织结构", css: "icon-user", showIcon: true, url: "<%=UrlHelper.resolveWithReturnUrl("/orgfrmger/bind/{0}", request.getAttribute("requestUrl"), request.getAttribute("requestQuery"), pageContext)%>",
                    selector: "#data-table .checkboxes", mustSelect: "请先选择数据！", singleSelect: "该操作只支持单选！"},
                { link: true, display: "删除", css: "icon-trash", showIcon: true, url: "<%=UrlHelper.resolveWithReturnUrl("/account/delete/{0}", request.getAttribute("requestUrl"), request.getAttribute("requestQuery"), pageContext)%>",
                    selector: "#data-table .checkboxes", mustSelect: "请先选择数据！", confirm: "确认删除所选数据吗？"}
            ]
        });
    });
    /*//初始化fileinput控件（第一次初始化）
     function initFileInput(ctrlName, uploadUrl) {
     var control = $('#' + ctrlName);
     control.fileInput({
     language: 'zh', //设置语言
     uploadUrl: uploadUrl, //上传的地址
     allowedFileExtensions : ['xls', 'xlsx'],//接收的文件后缀
     showUpload: false, //是否显示上传按钮
     showCaption: false,//是否显示标题
     browseClass: "btn btn-primary" //按钮样式
     });
     }
     //初始化fileinput控件（第一次初始化）
     initFileInput("excelFileUpload", "/orgfrmger/excelFileUpload");*/
   /* function uploadExcel(){
        $.ajax({
            url : "/orgfrmger/excelFileUpload",
            type : "post",
            data : $("#excelform").serialize(),     //此处表单序列化
            dataType : "json",
            success : function(data) {
                alert("导入成功！");
            },
            error : function() {
                alert("导入失败！");
            }
        });
    }*/
    //只能导入excel文件
    function uploadExcel(){
        var filename = $("#excelFileUpload").val();
        var suffix = filename.substring(filename.lastIndexOf("."),filename.length);
        if(".xls" == suffix || ".xlsx" == suffix){
            $("#excelform").submit();
        }else{
            alert("只能上传excel文件！");
        }
    }
    if("${result}" != ""
            && "${result}" != null){
        alert("${result}");
    }
</script>
<!-- END JAVASCRIPTS -->
</body>
<!-- END BODY -->
</html>